package com.work.tactics.controller;

import com.work.tactics.ao.FormAO;
import com.work.tactics.vo.FormVO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/forms")
public class FormController {


    @RequestMapping(value = "/getForms", method = RequestMethod.POST)
    public ResponseEntity<String> getForms(@RequestBody FormAO form){
        String flag = form.getFlag();
        FormVO formVO = new FormVO();
        String name = null;
        switch (flag){
            case "01":
                name = formVO.getName1();
                break;
            case "02":
                name = formVO.getName2();
                break;
            case "03":
                name = formVO.getName3();
                break;
            case "04":
                name = formVO.getName4();
                break;
            case "05":
                name = formVO.getName5();
                break;
            case "06":
                name = formVO.getName6();
                break;
            case "07":
                name = formVO.getName7();
                break;
            case "08":
                name = formVO.getName8();
                break;
            case "09":
                name = formVO.getName9();
                break;
            case "10":
                name = formVO.getName10();
                break;
        }
        return ResponseEntity.ok(name);
    }
}
